using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace WAVMP3Recorder
{
  public partial class OptionsPanel : UserControl
  {

    public string RecordSource
    {
      get
      {
        return cbSources.Text;
      }
      set
      {
        cbSources.Text = value;
      }
    }

    public OptionsPanel()
    {
      InitializeComponent();
    }

    private void OptionsPanel_Load(object sender, EventArgs e)
    {
      try
      {
        WAVRecorder.EnumCaptureDevices(cbSources);
        cbSources.SelectedValueChanged += new EventHandler(cbSources_SelectedValueChanged);
      }
      catch
      {
      }
    }

    void cbSources_SelectedValueChanged(object sender, EventArgs e) {
      ComboBox s = (ComboBox)sender;
      ComboBoxItem<Guid> item=(ComboBoxItem<Guid>) s.SelectedItem;
      WAVRecorder.setRecordDevice(item.Value);
    }
  }
}
